package com.itheima09;

public abstract class YingXiong {
    private String name;
    private int Hp;
    private int Mp;
    private int ATK;
    private int DEF;

    public YingXiong() {
    }

    public YingXiong(String name, int hp, int mp, int ATK, int DEF) {
        this.name = name;
        Hp = hp;
        Mp = mp;
        this.ATK = ATK;
        this.DEF = DEF;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHp() {
        return Hp;
    }

    public void setHp(int hp) {
        Hp = hp;
    }

    public int getMp() {
        return Mp;
    }

    public void setMp(int mp) {
        Mp = mp;
    }

    public int getATK() {
        return ATK;
    }

    public void setATK(int ATK) {
        this.ATK = ATK;
    }

    public int getDEF() {
        return DEF;
    }

    public void setDEF(int DEF) {
        this.DEF = DEF;
    }

    @Override
    public String toString() {
        return "YingXiong{" +
                "name='" + name + '\'' +
                ", Hp=" + Hp +
                ", Mp=" + Mp +
                ", ATK=" + ATK +
                ", DEF=" + DEF +
                '}';
    }

    public abstract void JiNeng1();

    public abstract void JiNeng2();

    public abstract void JiNeng3();

    public abstract void JiNeng4();

    public abstract void speak();

    public void sharen(JiNeng n) {
        int Xiaohao = n.getXiaoHao();
        if (this.Mp < Xiaohao){
            System.out.println("mp不足，技能无法发动");
        }else{
            this.Mp-=Xiaohao;
            double sh=n.getDamager()*this.ATK;
            System.out.println(this.name+"发动技能"+n.getName()+"消耗了"+Xiaohao+"对敌人造成了"+sh+"点伤害");
        }


    }
}
